﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace rajitWorkTwo
{
    static class logControl
    {
        // SOMETHING LIKE THIS WILL DEFINITELY WORK AND WE CAN SET INDIVIDUAL PIXELS TO WHITE TO MAKE THE WORKLOG SMALLER
        // JUST NEED TO FIGURE OUT THE BEST PLACE TO PUT IN AS IT GIVES AN EXCEPTION CURRENTLY.
        /*
        if (keyboardState.IsKeyDown(Keys.Space))
        {
            Color[] data = new Color[toolOne.sprite.Width * toolOne.sprite.Height];
            toolOne.sprite.GetData(data);
            data[4 * toolOne.sprite.Width + 3] = Color.White;
            toolOne.sprite.SetData(data);
        }*/
        public static Texture2D modifyWorkLogSprite(Texture2D workLogSprite, int height, int width)
        {
            Color[] data = new Color[workLogSprite.Width * workLogSprite.Height];
            workLogSprite.GetData(data);


            for (int i = 0; i < workLogSprite.Width; i++)
            {
                for (int j = 0; j < workLogSprite.Height; j++)
                {
                    data[i * workLogSprite.Height + j] = Color.Yellow;
                }
            }


            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    data[(workLogSprite.Width * j) + i] = Color.Red;
                }
            }

            workLogSprite.SetData(data);
            Texture2D returnSprite = workLogSprite;
            return (returnSprite);


        }
    }
}
